package com.cesce.batch.cobros.items.listeners;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.annotation.AfterProcess;
import org.springframework.batch.core.annotation.AfterWrite;
import org.springframework.batch.core.annotation.BeforeWrite;
import org.springframework.batch.core.annotation.OnProcessError;
import org.springframework.batch.core.annotation.OnReadError;
import org.springframework.batch.core.annotation.OnSkipInProcess;
import org.springframework.batch.core.annotation.OnWriteError;

import com.cesce.batch.cobros.reverse.Cobcomunicados;
import com.cesce.batch.cobros.reverse.Cobestados;

public class ComunicadoErroneoListener {

	protected final Log logger = LogFactory.getLog(getClass());

	protected int count=0;
	
	@OnSkipInProcess
    public void onSkipInProcess(Cobcomunicados item, Throwable e) {
    	item.setIdestado(Cobestados.findCobestados(Cobestados.ID_COMUNICADO_ERRONEO));
    	item.persist();
    	logger.debug("skip exception ");  
    }
	
}
